﻿<%@ Page Language="C#" MasterPageFile="~/Provider/CarInsurance/Liberty_CarInsurance.master" AutoEventWireup="true" CodeFile="AddNewRSAInsurance.aspx.cs" Inherits="provider_CarInsurance_AddNewRSAInsurance" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="provider_inner">
        <h1>
            Add/Edit Coverage Type
            <asp:Label ID="lblLibertyId" runat="server" Visible="false"></asp:Label></h1>
        <fieldset>
            <dl>
                <dt>
                    <label>
                        CX Coverage Type</label></dt>
                <dd>
                    <asp:DropDownList ID="ddlCXCoverageType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCXCoverageType_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfvCXCoverageRate" runat="server" InitialValue="-1"
                        ControlToValidate="ddlCXCoverageType" ErrorMessage="Select Coverage type to match."></asp:RequiredFieldValidator>
                         <asp:Label ID="lblCarIns" runat="server" Text="0" Visible="false"></asp:Label>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Your Coverage Type</label></dt>
                <dd>
                    <asp:TextBox ID="txtYourCoverageType" Width="350px" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvYourCoverageType" runat="server" ControlToValidate="txtYourCoverageType"
                        ErrorMessage="Require your coverage type."></asp:RequiredFieldValidator>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Coverage Rate</label></dt>
                <dd>
                    <asp:TextBox ID="txtCoverageRate" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvCoverageRate" runat="server" ControlToValidate="txtCoverageRate"
                        ErrorMessage="Enter your coverage rate." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revCoverageRate" runat="server" ControlToValidate="txtCoverageRate"
                        ErrorMessage="Coverate rate value is not valid." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Minimum Premium</label></dt>
                <dd>
                    <asp:TextBox ID="txtMinimumPremium" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvMinimumPremium" runat="server" ControlToValidate="txtMinimumPremium"
                        ErrorMessage="Enter your minimum premium value." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revMinimumPremium" runat="server" ControlToValidate="txtMinimumPremium"
                        ErrorMessage="Minimum Premium value is not valid." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Maximum Premium</label></dt>
                <dd>
                    <asp:TextBox ID="txtMaximumPremium" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvMaximumPremium" runat="server" ControlToValidate="txtMaximumPremium"
                        ErrorMessage="Enter your maximum premium value." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revtMaximumPremium" runat="server" ControlToValidate="txtMinimumPremium"
                        ErrorMessage="Maximum Premium value is not valid." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
            <%-- <dl>
        	    <dt><label>Type of Plan</label></dt>
                <dd>
                    <asp:RadioButtonList ID="rdoPlanType" runat="server" OnSelectedIndexChanged="ShowPreview" AutoPostBack="true">               
                    </asp:RadioButtonList>
                </dd>
            </dl>
            <dl>
        	    <dt><label>Policy Name</label></dt>
                <dd>
                    <asp:TextBox ID="txtPolicyName" runat="server" Width="250px"></asp:TextBox>
                    <asp:RequiredFieldValidator validationErrorCssClass="validationError" ID="rfvPolicyName"
                        runat="server" ControlToValidate="txtPolicyName" ErrorMessage="Enter Policy Name"></asp:RequiredFieldValidator>
                </dd>
            </dl>--%>
        </fieldset>
        <h2>
            Coverage Benefits</h2>
        <fieldset>
            <legend>1. Personal Accident</legend>
            <dl>
                <dt>
                    <label>
                        <asp:CheckBox ID="cbIsPersonalAccident" runat="server" />
                        <i class="blackfont">not applicable</i>
                    </label>
                </dt>
                <dd>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Policy Holder</label></dt>
                <dd>
                    $<asp:TextBox ID="txtPolicyHolder" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvPolicyHolder" runat="server" ControlToValidate="txtPolicyHolder"
                        ErrorMessage="Enter policy holder value." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revPolicyHolder" runat="server" ControlToValidate="txtPolicyHolder"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Passengers (each)</label></dt>
                <dd>
                    $<asp:TextBox ID="txtPassengers" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvPassengers" runat="server" ControlToValidate="txtPassengers"
                        ErrorMessage="Enter passengers." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revtxtPassengers" runat="server" ControlToValidate="txtPassengers"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Accumulated total not exceeding</label></dt>
                <dd>
                    $<asp:TextBox ID="txtAccumulated" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvtxtAccumulated" runat="server" ControlToValidate="txtAccumulated"
                        ErrorMessage="Enter accumulated value." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revtxtAccumulated" runat="server" ControlToValidate="txtAccumulated"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
        </fieldset>
        <fieldset>
            <legend>2. Medical Expenses</legend>
            <dl>
                <dt>
                    <label>
                        <asp:CheckBox ID="cbIsMedicalExp" runat="server" />
                        <i class="blackfont">not applicable</i>
                    </label>
                </dt>
                <dd>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Each</label></dt>
                <dd>
                    $<asp:TextBox ID="txtMedicalExp" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvMedicalExp" runat="server" ControlToValidate="txtMedicalExp"
                        ErrorMessage="Enter Medical Expenses." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revMedicalExp" runat="server" ControlToValidate="txtMedicalExp"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
        </fieldset>
        <fieldset>
            <legend>3. Loss of Use</legend>
            <dl>
                <dt>
                    <label>
                        <asp:CheckBox ID="cbIsCashAllowance" runat="server" />
                        <i class="blackfont">not applicable</i>
                    </label>
                </dt>
                <dd>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        i) Cash Allowance</label></dt>
                <dd>
                    $<asp:TextBox ID="txtCashPerDay" runat="server"></asp:TextBox>/day
                    <asp:RequiredFieldValidator ID="rfvCashPerDay" runat="server" ControlToValidate="txtCashPerDay"
                        ErrorMessage="Enter Cash Per Day." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revCashPerDay" runat="server" ControlToValidate="txtCashPerDay"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        &nbsp;</label></dt>
                <dd>
                    max<asp:TextBox ID="txtCashDays" runat="server" MaxLength="2"></asp:TextBox>days
                    <asp:RequiredFieldValidator ID="rfvCashDays" runat="server" ControlToValidate="txtCashDays"
                        ErrorMessage="Enter Max No. of Days." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revCashDays" runat="server" ControlToValidate="txtCashDays"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        <asp:CheckBox ID="cbIsCourtesyCar" runat="server" />
                        <i class="blackfont">not applicable</i>
                    </label>
                </dt>
                <dd>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        ii) Courtesy Car</label></dt>
                <dd>
                    max<asp:TextBox ID="txtCourtesyCar" runat="server" MaxLength="2"></asp:TextBox>days
                    <asp:RequiredFieldValidator ID="rfvCourtesyCar" runat="server" ControlToValidate="txtCourtesyCar"
                        ErrorMessage="Enter Max No. of Days." Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revCourtesyCar" runat="server" ControlToValidate="txtCourtesyCar"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
        </fieldset>
        <fieldset>
            <legend>4. Loss of Personal Effects</legend>
            <dl>
                <dt>
                    <label>
                        <asp:CheckBox ID="cbIsPersonalEffect" runat="server" />
                        <i class="blackfont">not applicable</i>
                    </label>
                </dt>
                <dd>
                    $<asp:TextBox ID="txtPEffect" runat="server"></asp:TextBox>/occurence
                    <asp:RequiredFieldValidator ID="rfvPEffect" runat="server" ControlToValidate="txtPEffect"
                        ErrorMessage="Enter Personal Effects" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revPEffect" runat="server" ControlToValidate="txtPEffect"
                        ErrorMessage="Invalid value." ValidationExpression="^[0-9]+(\.[0-9]{1,2})?$"></asp:RegularExpressionValidator>
                </dd>
            </dl>
        </fieldset>
        <fieldset>
            <legend>5. NCD Protection</legend>
            <dl>
                <dt>
                    <label>
                        Select NCD Protection</label></dt>
                <dd>
                    <asp:RadioButtonList ID="rdoNCD" runat="server">
                        <asp:ListItem Selected="True" Value="True">Inclusive</asp:ListItem>
                        <asp:ListItem Value="False">Not Applicable</asp:ListItem>
                    </asp:RadioButtonList>
                </dd>
            </dl>
        </fieldset>
        <fieldset>
            <legend>6. Policy Writing/Document</legend>
            <dl>
                <dt>
                    <label>
                        Select Policy</label></dt>
                <dd>
                    <asp:DropDownList ID="ddlPolicyDoc" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfvPolicyDoc" runat="server" InitialValue="-1" ControlToValidate="ddlPolicyDoc"
                        ErrorMessage="Select Policy document."></asp:RequiredFieldValidator>
                </dd>
                </dd>
            </dl>
        </fieldset>
        <fieldset>
            <legend>7. Promotion</legend>
            <dl>
                <dt>
                    <label>
                        Select Promotion</label></dt>
                <dd>
                    <asp:DropDownList ID="ddlPromotion" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfvPromotion" runat="server" InitialValue="-1" ControlToValidate="ddlPromotion"
                        ErrorMessage="Select Promotion."></asp:RequiredFieldValidator>
                </dd>
            </dl>
        </fieldset>
         <fieldset>
            <legend>8. Policy Info</legend>
            <dl>
                <dt>
                    <label>
                        Select Policy Info</label></dt>
                <dd>
                    <asp:DropDownList ID="ddlPolicyInfo" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfvPolicyInfo" runat="server" InitialValue="-1" ControlToValidate="ddlPolicyInfo"
                        ErrorMessage="Select Policy Info."></asp:RequiredFieldValidator>
                </dd>
            </dl>
        </fieldset>
        <fieldset>
            <legend>9. Status</legend>
            <dl>
                <dt>
                    <label>
                        Select Status</label></dt>
                <dd>
                    <asp:CheckBox ID="cbStatus" runat="server" Text="Status" Checked="true" />
                </dd>
            </dl>
            <dl>
                <dt>
                    <label>
                        Auth Code</label></dt>
                <dd>
                    <asp:TextBox ID="txtAuthCode" runat="server" TextMode="Password" MaxLength="12" Width="150px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvAuthCode" runat="server" ControlToValidate="txtAuthCode"
                        ErrorMessage="Enter auth code."></asp:RequiredFieldValidator>
                </dd>
            </dl>
        </fieldset>
        <asp:Label ID="lblMessage" runat="server" CssClass="successmsg"></asp:Label>
        <table id="tbPreview" class="preview_tbl" width="100%">
            <tr>
                <th>
                    Policyholder
                </th>
                <th>
                    Passengers (each)
                </th>
                <th>
                    Medical Expenses
                </th>
                <th>
                    Cash Allowance
                </th>
                <th>
                    Car Replacement
                </th>
                <th>
                    WorkShop Plan
                </th>
                <th>
                    NCD Protection Inclusive
                </th>
            </tr>
            <tr>
                <td>
                    <input type="text" runat="server" id="lblPolicy" readonly="readonly" />
                </td>
                <td>
                    <input type="text" runat="server" id="lblPassengers" readonly="readonly" />
                </td>
                <td>
                    <input type="text" runat="server" id="lblMedicalExp" readonly="readonly" />
                </td>
                <td>
                    <input type="text" runat="server" id="lblCashAllowance" readonly="readonly" />
                </td>
                <td>
                    <input type="text" runat="server" id="lblCarReplacement" readonly="readonly" />
                </td>
                <td>
                    <input type="text" runat="server" id="lblWorkshop" readonly="readonly" />
                </td>
                <td>
                    <input type="text" runat="server" id="lblNCD" readonly="readonly" />
                </td>
            </tr>
        </table>
        <fieldset class="action">
            <asp:ImageButton OnClientClick="javascript:return confirm('Are you sure to go back?');"
                ID="ibtBack" runat="server" CssClass="left_btn" ImageUrl="~/Provider/images/buttons/back1.gif"
                OnClick="ibtBack_Click" />
            <asp:ImageButton ID="btnSave" runat="server" CssClass="float_btn" ImageUrl="~/Provider/images/buttons/save_insurance1.gif"
                OnClick="btnSave_Click" />
            <asp:ImageButton ID="btnDelete" runat="server" CssClass="floatnext_btn" ImageUrl="~/Provider/images/buttons/delete1.gif"
                OnClientClick="javascript:return confirm('Are you sure you want to remove this record?');"
                OnClick="btnDelete_Click" />
        </fieldset>
    </div>

    <script type="text/javascript">

        function GetPolicy() {

            var txtpolicy = document.getElementById('<%=txtPolicyHolder.ClientID%>');
            var lblpolicy = document.getElementById('<%=lblPolicy.ClientID%>');
            lblpolicy.value = txtpolicy.value;

        }

        function GetPassengers() {

            var txtpassengers = document.getElementById('<%=txtPassengers.ClientID%>');
            var lblpassengers = document.getElementById('<%=lblPassengers.ClientID%>');
            lblpassengers.value = txtpassengers.value;
        }

        function GetMedicalExp() {

            var txtMedicalExp = document.getElementById('<%=txtMedicalExp.ClientID%>');
            var lblMedicalExp = document.getElementById('<%=lblMedicalExp.ClientID%>');
            lblMedicalExp.value = txtMedicalExp.value;
        }

        function GetCashAllowance() {

            var txtCashPerDay = document.getElementById('<%=txtCashPerDay.ClientID%>');
            var txtCashDays = document.getElementById('<%=txtCashDays.ClientID%>');
            var lblCashAllowance = document.getElementById('<%=lblCashAllowance.ClientID%>');
            lblCashAllowance.value = '$' + txtCashPerDay.value + '/day max ' + txtCashDays.value + ' days';
            //"$" + txtCashPerDay.Text.Trim() + "/day max " + txtCashDays.Text.Trim() + " days";

        }

        function GetCarReplacement() {

            var txtCourtesyCar = document.getElementById('<%=txtCourtesyCar.ClientID%>');
            var lblCarReplacement = document.getElementById('<%=lblCarReplacement.ClientID%>');
            lblCarReplacement.value = txtCourtesyCar.value;


        }

        function GetNCD(item) {
            var lblNCD = document.getElementById('<%=lblNCD.ClientID%>');

            if (item.value == 'True')
                lblNCD.value = 'Inclusive';
            else
                lblNCD.value = 'Not Applicable';

        }

        function PersonalAccidentApplicable(item) {
            var txtPolicy = document.getElementById('<%=txtPolicyHolder.ClientID%>');
            var txtPassengers = document.getElementById('<%=txtPassengers.ClientID%>');
            var txtAccumulated = document.getElementById('<%=txtAccumulated.ClientID%>');


            if (item.checked == true) {
                txtPolicy.disabled = true;
                txtPassengers.disabled = true;
                txtAccumulated.disabled = true;
                txtPolicy.value = '0';
                txtPassengers.value = '0';
                txtAccumulated.value = '0';
                GetPolicy();
                GetPassengers();

            }
            else {
                txtPolicy.disabled = false;
                txtPassengers.disabled = false;
                txtAccumulated.disabled = false;
            }

        }


        function MedicalExpenseApplicable(item) {
            var txtMedicalExp = document.getElementById('<%= txtMedicalExp.ClientID%>');

            if (item.checked == true) {
                txtMedicalExp.disabled = true;
                txtMedicalExp.value = '0';
                GetMedicalExp();
            }
            else {
                txtMedicalExp.disabled = false;
            }

        }

        function CashAllowanceApplicable(item) {
            var txtCashDays = document.getElementById('<%= txtCashDays.ClientID%>');
            var txtCashPerDay = document.getElementById('<%= txtCashPerDay.ClientID%>');

            if (item.checked == true) {
                txtCashDays.disabled = true;
                txtCashPerDay.disabled = true;
                txtCashDays.value = '0';
                txtCashPerDay.value = '0';
                GetCashAllowance();
            }
            else {
                txtCashDays.disabled = false;
                txtCashPerDay.disabled = false;
            }

        }

        function CourtesyCarApplicable(item) {
            var txtCourtesyCar = document.getElementById('<%= txtCourtesyCar.ClientID%>');

            if (item.checked == true) {
                txtCourtesyCar.disabled = true;
                txtCourtesyCar.value = '0';
                GetCarReplacement();
            }
            else {
                txtCourtesyCar.disabled = false;
            }

        }

        function PersonalEffectApplicable(item) {
            var txtPEffect = document.getElementById('<%=txtPEffect.ClientID%>');

            if (item.checked == true) {
                txtPEffect.disabled = true;
                txtPEffect.value = '0';
            }
            else {
                txtPEffect.disabled = false;
            }

        }
    </script>

</asp:Content>
